#include "../../third/aip-cpp-sdk-4.16.7/speech.h"

void asr(aip::Speech& client)
{
    // 无可选参数调用接口
    std::string file_content;
    aip::get_file_content("./16k.pcm", &file_content);

    Json::Value result = client.recognize(file_content, "pcm", 16000, aip::null);
    if (result["err_no"].asInt() != 0)
    {
        std::cout << result["err_msg"].asString() << std::endl;
    }
    std::cout << result["result"][0].asString() << std::endl;
}

int main()
{
    aip::Speech client("115947624","vhZrUsVy2ydS6lSGnDrlsiQN","yKVLcLDauDVbeLHdkFNzGrSLeDq6APBE");
    asr(client);
    return 0;
}